package lab03.text12;
//import java.sql.*;
/**
 * Created by Administrator on 2017/12/13.
 */
public class Text {
    /*public static void main(String[] args) {
        Connection connection=null;
        Statement statement=null;
        ResultSet resultSet = null;
        String sql="select * FROM t_users";
        String sql1="select * FROM t_users where username='admin'" ;
        String sql2="select * from t_users where username='admin' and password='123456'";
        String sql3="select * from t_users where register_datetime>10000000";
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            connection= DriverManager.getConnection(
                    "jdbc:mysql://localhost:3306/java_2017?serverTimezone=UTC",
                    "root",
                    "123456"
            );
            statement = connection.createStatement();
            resultSet = statement.executeQuery(sql);
            resultSet = statement.executeQuery(sql1);
            resultSet = statement.executeQuery(sql2);
            resultSet = statement.executeQuery(sql3);
            while (resultSet.next()) {
                System.out.println(resultSet.getString(1) + " " + resultSet.getString(2)  " " + resultSet.getString(3) + " " + resultSet.getString(4));}} catch (ClassNotFoundException e) {
            e.printStackTrace();}
        catch (SQLException e) {e.printStackTrace();
        }finally {
            try {statement.close();
                connection.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }*/
}
